// Moosync
// Copyright (C) 2024, 2025  Moosync <support@moosync.app>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

use leptos::{component, prelude::*, view, IntoView};

#[tracing::instrument(level = "debug", skip())]
#[component]
pub fn RandomIcon() -> impl IntoView {
    view! {
        <svg
            class="button-grow"
            height="25"
            viewBox="0 0 25 28"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
        >
            <title>Play Random</title>
            <path
                d="M12.4805 0.621346C12.0743 0.621346 11.668 0.712374 11.3534 0.894431L1.3065 6.70604C0.677057 7.07016 0.677057 7.64593 1.3065 8.01004L11.3534 13.8217C11.9828 14.1858 12.9781 14.1858 13.6075 13.8217L23.6544 8.01004C24.2838 7.64599 24.2838 7.07016 23.6544 6.70611L13.6075 0.894497C13.2928 0.712308 12.8866 0.621346 12.4805 0.621346V0.621346ZM12.4263 4.1145C13.0191 4.12088 13.5521 4.2567 14.0252 4.52176C14.3488 4.70316 14.5608 4.91001 14.661 5.14251C14.7579 5.37317 14.7636 5.67724 14.6781 6.05444L14.5728 6.42974C14.5031 6.69828 14.4886 6.89145 14.5294 7.00919C14.5669 7.12521 14.6599 7.22479 14.8084 7.30805L15.0314 7.43289L12.8455 8.65756L12.6026 8.52161C12.3317 8.36994 12.159 8.19854 12.0841 8.00728C12.006 7.81424 12.019 7.50721 12.1232 7.08614L12.2234 6.70808C12.2817 6.48295 12.2874 6.29832 12.2405 6.15441C12.1975 6.00814 12.1001 5.89244 11.9482 5.80734C11.717 5.67776 11.4401 5.63133 11.1175 5.6677C10.7915 5.7023 10.455 5.81687 10.1079 6.01136C9.78089 6.19453 9.48393 6.42388 9.21669 6.69933C8.94624 6.97308 8.7142 7.28628 8.52037 7.63909L6.96486 6.76748C7.31463 6.41625 7.65829 6.1091 7.9959 5.84581C8.33357 5.58272 8.69006 5.34595 9.06548 5.13547C10.0505 4.58365 10.9665 4.25545 11.8134 4.15107C12.0167 4.12494 12.2215 4.1127 12.4264 4.11443L12.4263 4.1145ZM15.7647 7.84377L17.5284 8.83193L15.3424 10.0566L13.5787 9.06851L15.7647 7.84383V7.84377ZM0.635621 9.11093C0.257234 9.10074 0 9.39612 0 9.91861V20.2906C0 21.0175 0.497894 21.8798 1.12733 22.2434L10.7912 27.824C11.4206 28.1874 11.9185 27.9 11.9185 27.1732V16.801C11.9185 16.0741 11.4206 15.2119 10.7912 14.8484L1.12733 9.2678C0.950406 9.16552 0.783673 9.11475 0.635621 9.1108V9.11093ZM24.3644 9.11106C24.2164 9.11501 24.0498 9.16565 23.8728 9.26793L14.2086 14.8485C13.5792 15.212 13.0813 16.0743 13.0813 16.8013V27.1735C13.0813 27.9003 13.5792 28.1876 14.2086 27.824L23.8729 22.2436C24.5023 21.8801 25 21.0179 25 20.291V9.91874C25 9.39638 24.7428 9.10106 24.3644 9.11119V9.11106ZM3.21572 13.3042C3.64673 13.394 4.04037 13.504 4.39659 13.6339C4.75369 13.7642 5.09876 13.9254 5.4279 14.1157C6.29694 14.6175 6.95947 15.1893 7.4154 15.8311C7.87133 16.4691 8.09929 17.1496 8.09929 17.8727C8.09929 18.2436 8.0299 18.5366 7.89093 18.7517C7.75202 18.9629 7.51511 19.1404 7.18033 19.284L6.83831 19.4103C6.59614 19.5051 6.43757 19.6029 6.36278 19.7036C6.288 19.8005 6.25064 19.934 6.25064 20.1043V20.3598L4.32188 19.2461V18.9679C4.32188 18.6575 4.38055 18.417 4.49815 18.2464C4.61568 18.072 4.86331 17.9083 5.24084 17.7553L5.58286 17.6233C5.7859 17.5438 5.93369 17.4437 6.02629 17.323C6.12232 17.2044 6.17047 17.058 6.17047 16.8839C6.17047 16.619 6.08496 16.3633 5.91395 16.117C5.74295 15.8668 5.50439 15.6533 5.19803 15.4763C4.90948 15.3098 4.59779 15.1942 4.26295 15.1296C3.92817 15.0612 3.57905 15.0471 3.21572 15.0872V13.3041V13.3042ZM20.9439 13.8703C21.044 13.8703 21.1367 13.8811 21.2223 13.9027C21.6782 14.0142 21.9062 14.4315 21.9062 15.1546C21.9062 15.5255 21.8367 15.8987 21.6978 16.2742C21.5589 16.6458 21.322 17.0968 20.9872 17.627L20.6452 18.1482C20.403 18.5228 20.2444 18.8035 20.1696 18.9905C20.0949 19.1737 20.0575 19.3505 20.0575 19.5209V19.7764L18.1287 20.89V20.6118C18.1287 20.3014 18.1875 19.9929 18.305 19.6866C18.4227 19.3765 18.6702 18.9269 19.0477 18.338L19.3897 17.8112C19.5928 17.4971 19.7405 17.2262 19.8331 16.9986C19.9292 16.769 19.9773 16.567 19.9773 16.3929C19.9773 16.1279 19.8918 15.971 19.7209 15.9221C19.5499 15.8695 19.3112 15.9314 19.0049 16.1082C18.7163 16.2748 18.4048 16.5193 18.0699 16.8412C17.7352 17.1596 17.386 17.5484 17.0227 18.008V16.225C17.4537 15.8172 17.8472 15.4725 18.2033 15.1912C18.5596 14.9098 18.9035 14.6735 19.2346 14.4823C19.9409 14.0745 20.5106 13.8705 20.944 13.8702L20.9439 13.8703ZM4.32181 20.0867L6.25064 21.2002V23.2218L4.32188 22.1083V20.0868L4.32181 20.0867ZM20.0575 20.6168V22.6383L18.1287 23.7518V21.7305L20.0576 20.6168H20.0575Z"
                fill="var(--accent)"
            ></path>
        </svg>
    }
}
